#include <iostream>
#include <signal.h>
using namespace std;

void sigcb(int num)
{
    cout << "signum is:" << num << endl;
}

int main()
{
    signal(2, sigcb);
    signal(40, sigcb);
    sigset_t set;
    sigemptyset(&set);
    sigaddset(&set, 2);
    sigaddset(&set, 40);
    sigprocmask(SIG_BLOCK, &set, nullptr);
    while(1)
    {
        cout << "process is running" << endl;
        sleep(1);
    }
    return 0;
}